import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/ruoyi"

// 查询运输单位类型列表
export function listCustoms(query) {
  return request({
    url: '/customs/list',
    method: 'get',
    params: query
  })
}

// 查询运输单位类型列表
export function getCustoms(query) {
  return request({
    url: '/customs/getCustoms/'+ praseStrEmpty(query),
    method: 'get'
  })
}

// 新增运输单位类型
export function addCustoms(data) {
  return request({
    url: '/customs/add',
    method: 'post',
    data: data
  })
}

// 修改运输单位类型
export function updateCustoms(data) {
  return request({
    url: '/customs/edit',
    method: 'put',
    data: data
  })
}

// 新增或修改运输单位类型
export function addAndUpdateCustoms(data) {
  return request({
    url: '/customs',
    method: 'put',
    data: data
  })
}

// 删除运输单位类型
export function delCustoms(ids) {
  return request({
    url: '/customs/remove/' + ids,
    method: 'delete'
  })
}

// 查询运输单位类型条件列表
export function listIsoUnit(query) {
  return request({
    url: '/transport/isoUnit/list',
    method: 'get',
    params: query
  })
}

// 导出用户
export function exportCustoms(ids) {
  return request({
    url: '/customs/export/'+ ids,
    method: 'get'
  })
}

// 下载用户导入模板
export function importTemplate() {
  return request({
    url: '/customs/importTemplate',
    method: 'get'
  })
}
